package com.ht.db.router.config;

import com.alibaba.druid.pool.DruidDataSource;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

@Data
@Component
@ConfigurationProperties(prefix = "mini-db-router.jdbc.datasource")
public class DBRouterProperties {

    /**
     * db的数量
     */
    private Integer dbCount;

    /**
     * 表的数量
     */
    private Integer tbCount;

    /**
     * 默认db
     */
    private String defaultDB;

    /**
     * 分库分表路由字段
     */
    private String routerKey;

    /**
     * 多数据源数据库配置
     */
    private Map<String, DruidDataSource> databases;

}
